<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('diymodel_add'); ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>添加自定义模型</title>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="templates/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="plugin/layer/layer.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/jquery.nicescroll.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/layindex.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/common.js"></script>
<script type="text/javascript" charset="utf-8" src="templates/js/Validform_v5.3.2_min.js"></script>


<script type="text/javascript">
    $(function () {
        //初始化表单验证
        $("#form1").initValidform();
    });
	function checkfun(id){
		
		var val = document.getElementById(id).value; 
		document.getElementById("modeltbname").value=val; 
	};
</script>
</head>
<body class="mainbody">
<form method="post" id="form1" action="diymodel_save.php" >
<!--导航栏-->
<div class="location">
  <a href="diymodel.php" class="back"><i></i><span>返回列表页</span></a>
  <a href="home.php" class="home"><i></i><span>首页</span></a>
  <i class="arrow"></i>
  <a href="admin.php"><span>自定义模型</span></a>
  <i class="arrow"></i>
  <span>添加自定义模型</span>
   <a href="javascript:location.reload();" class="reload">刷新</a>
</div>
<div class="line10"></div>
<!--/导航栏-->

<!--内容-->
<div id="floatHead" class="content-tab-wrap">
  <div class="content-tab">
    <div class="content-tab-ul-wrap">
      <ul>
        <li><a class="selected" href="javascript:;">添加自定义模型</a></li>
      </ul>
    </div>
  </div>
</div>

<div class="tab-content">
  <dl>
    <dt>模型标识：</dt>
    <dd>
   <input type="text" name="modelname" id="modelname" class="input" onblur="checkfun(this.id)"  /><span class="Validform_checktip">*仅由英文字母、数字和下划线组成，并且仅能字母开头，不能以下划线结尾</span>
    </dd>
  </dl>
  <dl>
    <dt>模型表名：</dt>
    <dd><input type="text" name="modeltbname" id="modeltbname" class="input" /><span class="Validform_checktip">*模型表名正常情况下可与模型标识相同 不需要加前缀</span></dd>
  </dl> 
  <dl>
    <dt>模型名称：</dt>
    <dd>
      <input type="text" name="modeltitle" id="modeltitle" class="input" />
      <span class="Validform_checktip">*用于模型名称的显示 例如:列表</span>
    </dd>
  </dl>
 
    <dl>
    <dt>模型URL：</dt>
    <dd><input type="text" name="modelurl" id="modelurl" value="modeldata.php" class="input" /><span class="Validform_checktip">*不建议更改，否则，需要后台手动添加该文件,并编写数据处理文件。</span></dd>
  </dl> 
  <dl>
    <dt>预设字段：</dt>
	<dd> <div class="rule-multi-porp">
          <span id="cblActionType">
		  <input id="defaultfield[]0" type="checkbox" name="defaultfield[]" value="title" /><label for="defaultfield[]0">标　题(title)</label>
		  <input id="defaultfield[]1" type="checkbox" name="defaultfield[]" value="flag" /><label for="defaultfield[]1">属　性(flag)</label>
		  <input id="defaultfield[]2" type="checkbox" name="defaultfield[]" value="picurl" /><label for="defaultfield[]2">缩略图片(picurl)</label>
		  <input id="defaultfield[]3" type="checkbox" name="defaultfield[]" value="orderid" /><label for="defaultfield[]3">排列排序(orderid)</label>
		  <input id="defaultfield[]4" type="checkbox" name="defaultfield[]" value="posttime" /><label for="defaultfield[]4">更新时间(posttime)</label>
		  </span>
      </div></dd>
  </dl>
  <dl>
    <dt>排列排序：</dt>
  <dd>   <input name="orderid" type="text" value="99" id="orderid" class="input small" datatype="n" sucmsg=" " />
      <span class="Validform_checktip">*数字，越小越向前</span></dd>
  </dl> 
  <dl>
    <dt>启  用</dt>
    <dd>
      <div class="rule-single-checkbox">
          <input id="checkinfo" type="checkbox"name="checkinfo" value="true" checked="checked" />
      </div>
      <span class="Validform_checktip">*选否后不在可用。</span>
    </dd>
  </dl>
  
</div>
<!--/内容-->

<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
    <input type="submit" name="btnSubmit" value="提交保存" class="btn" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript:history.back(-1);" />
	<input type="hidden" name="action" id="action" value="add" />
  </div>
</div>
<!--/工具栏-->
</form>
</body>
</html>
